import java.io.*;

public class Test7 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\Java\\mixedTypes.dat";
        DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fileName)));

        out.writeInt(0);
        System.out.println(out.size() + "bytes hava been written.");

        out.writeDouble(31.2);
        System.out.println(out.size() + "bytes hava been written.");

        out.writeBytes("Java");
        System.out.println(out.size() + "bytes hava been written.");

        out.close();

//        BufferedReader in = new BufferedReader(new FileReader(fileName));
//
//        String line = in.readLine();
//
//        while (line != null) {
//            System.out.println(line);
//            line = in.readLine();
//        }
//        in.close();
    }
}
